package com.projiect.bean;

import com.projiect.dao.IClassBeanDao;
import com.projiect.dao.impl.IClassBeanDaoImpl;

public class StudentBean {
    //学号
    private int id;
    //姓名
    private String name;
    //班级
    private ClassBean classBean;
    private IClassBeanDao dao = new IClassBeanDaoImpl();

    public StudentBean() {
    }

    public StudentBean( String name, int classId) {
        this.name = name;
        classBean = dao.findClassById(classId);
    }

    @Override
    public String toString() {
        return "StudentBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", classBean=" + classBean +
                "\n";
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ClassBean getClassBean() {
        return classBean;
    }

    public void setClassBean(ClassBean classBean) {
        this.classBean = classBean;
    }
}
